package com.jiazhong.shopping.dao.impl;

import com.jiazhong.shopping.dao.DBUtil;
import com.jiazhong.shopping.dao.EatDao;
import com.jiazhong.shopping.model.Eat;

import java.util.List;
/*
EatDao接口的实现类
该类用于实际操作数据库
 */

public class EatDaoImpl extends DBUtil implements EatDao {
    @Override
    public List<Eat> queryEats() {
        String sql="select * from tbl_eat";
        return super.executeQueryList(sql,Eat.class);
    }

    @Override
    public Eat queryEatById(int eatId) {

        String sql = "select * from tbl_eat where eat_id=?";
        return super.executeQueryOne(sql,Eat.class,eatId);
    }

}
